<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    文件上传 <input type="file" onchange="upload(event)">
</body>
<script>
    function blobSlice(blob,startIndex,length){
        return blob.slice(startIndex,length);
    }
    function upload(event){
        let files = event.target.files;
        let blobs = blobSlice(files[0],0,11);
        let fileReader = new FileReader();
        fileReader.readAsText(blobs);
        fileReader.onload = function(){
            console.info('读取文件部分内容:',fileReader.result)
        }
    }
</script>
</html>